// 配置代理 - 用于联调
const {createProxyMiddleware} = require('http-proxy-middleware');

console.log('PROXY: ');

module.exports = function(app) {
  console.log(11111)
  app.use(
    createProxyMiddleware('/solar-health-degree-backend', {
      target: 'https://app-portal-pdc1.eniot.io/solar-health-degree-backend',
              //  https://app-portal-pdc1.eniot.io/solar-health-degree-backend/v1.0/getAssetTrees?num=0
              //  https://app-portal-pdc1.eniot.io/solar-health-degree-backend/v1.0/getAssetTree?num=0

      changeOrigin: true,
      pathRewrite(path) {
        return path.replace('/solar-health-degree-backend', '');
      }
    })
  );
};
